<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
    <title>隔行变色</title>
    <script type="text/javascript">
        $(function () {
            $("#select").click(function () {
                $("[name='cb']").prop("checked" , $("#select").prop("checked"));

            });

        });


    </script>
</head>
<body>
        <table border="1" width="800px">

            <tr>
                <td><input type="checkbox" id="select">全选</td>
                <td>id</td>
                <td>姓名</td>
                <td>年龄</td>
            </tr>
            <tr>
                <td><input type="checkbox" name="cb"></td>
                <td>1</td>
                <td>青龙</td>
                <td>18</td>

            </tr>
            <tr>
                <td><input type="checkbox" name="cb"></td>
                <td>2</td>
                <td>百福</td>
                <td>1</td>
            </tr>
            <tr>
                <td><input type="checkbox" name="cb"></td>
                <td>3</td>
                <td>3</td>
                <td>3</td>
            </tr>
            <tr>
                <td><input type="checkbox" name="cb"></td>
                <td>4</td>
                <td>5</td>
                <td>4</td>
            </tr>

        </table>


</body>
</html>